class Solution {
public:
    void moveZeroes(vector<int>& nums)
    {
        int cur, dest;
        for (cur = 0, dest = -1;cur < nums.size();cur++)
        {
            if (nums[cur])
            {
                swap(nums[++dest], nums[cur]);
            }

        }
    }
};